﻿// This class is "generated" and will be overwritten.
// Your customizations should be made in GasolineraRecord.cs

using System;
using System.Collections;
using System.Data.SqlTypes;
using BaseClasses;
using BaseClasses.Data;
using BaseClasses.Data.SqlProvider;

namespace EnGasAdoAPP.Business
{

/// <summary>
/// The generated superclass for the <see cref="GasolineraRecord"></see> class.
/// </summary>
/// <remarks>
/// This class is not intended to be instantiated directly.  To obtain an instance of this class, 
/// use the methods of the <see cref="GasolineraTable"></see> class.
/// </remarks>
/// <seealso cref="GasolineraTable"></seealso>
/// <seealso cref="GasolineraRecord"></seealso>
public class BaseGasolineraRecord : PrimaryKeyRecord
{

	public readonly static GasolineraTable TableUtils = GasolineraTable.Instance;

	// Constructors
 
	protected BaseGasolineraRecord() : base(TableUtils)
	{
		this.InsertingRecord += 
			new BaseClasses.IRecordWithTriggerEvents.InsertingRecordEventHandler(this.GasolineraRecord_InsertingRecord); 
		this.UpdatingRecord += 
			new BaseClasses.IRecordWithTriggerEvents.UpdatingRecordEventHandler(this.GasolineraRecord_UpdatingRecord); 
		this.ReadRecord +=
            new BaseClasses.IRecordWithTriggerEvents.ReadRecordEventHandler(this.GasolineraRecord_ReadRecord); 
	}

	protected BaseGasolineraRecord(PrimaryKeyRecord record) : base(record, TableUtils)
	{
	}
	
	
	//Audit Trail methods
	
	//Evaluates Initialize when->Reading record formulas specified at the data access layer
    protected virtual void GasolineraRecord_ReadRecord(Object sender,System.EventArgs e)
    {
        //Apply Initialize->Reading record formula only if validation is successful.
                GasolineraRecord GasolineraRec = (GasolineraRecord)sender;
        if(GasolineraRec != null && !GasolineraRec.IsReadOnly ){
                }
    
    }
        
	//Evaluates Initialize when->Inserting formulas specified at the data access layer
    protected virtual void GasolineraRecord_InsertingRecord(Object sender,System.ComponentModel.CancelEventArgs e)
    {
        //Apply Initialize->Inserting formula only if validation is successful.
                GasolineraRecord GasolineraRec = (GasolineraRecord)sender;
        Validate_Inserting();
        if(GasolineraRec != null && !GasolineraRec.IsReadOnly ){
                }
    
    }
    
    //Evaluates Initialize when->Updating formulas specified at the data access layer
    protected virtual void GasolineraRecord_UpdatingRecord(Object sender,System.ComponentModel.CancelEventArgs e)
    {
        //Apply Initialize->Updating formula only if validation is successful.
                GasolineraRecord GasolineraRec = (GasolineraRecord)sender;
        Validate_Updating();
        if(GasolineraRec != null && !GasolineraRec.IsReadOnly ){
                }
    
    }

   //Evaluates Validate when->Inserting formulas specified at the data access layer
	protected virtual void Validate_Inserting()
	{
		string fullValidationMessage = "";
		string validationMessage = "";
		
		

		if(validationMessage != "" && validationMessage.ToLower() != "true")
            fullValidationMessage = fullValidationMessage + validationMessage + "\r\n"; 
		
        if(fullValidationMessage != "")
			throw new Exception(fullValidationMessage);
	}
 
	//Evaluates Validate when->Updating formulas specified at the data access layer
	protected virtual void Validate_Updating()
	{
		string fullValidationMessage = "";
		string validationMessage = "";
		
		

		if(validationMessage != "" && validationMessage.ToLower() != "true")
            fullValidationMessage = fullValidationMessage + validationMessage + "\r\n"; 
		
        if(fullValidationMessage != "")
			throw new Exception(fullValidationMessage);
	}
	public virtual string EvaluateFormula(string formula, BaseRecord  dataSourceForEvaluate, string format)
    {
        Data.BaseFormulaEvaluator e = new Data.BaseFormulaEvaluator();
        
        // All variables referred to in the formula are expected to be
        // properties of the DataSource.  For example, referring to
        // UnitPrice as a variable will refer to DataSource.UnitPrice
        e.DataSource = dataSourceForEvaluate;

        Object resultObj = e.Evaluate(formula);
        if(resultObj == null) 
			return "";
        return resultObj.ToString();
	}







#region "Convenience methods to get/set values of fields"

	/// <summary>
	/// This is a convenience method that provides direct access to the value of the record's Gasolinera_.ID_Gasolinera field.
	/// </summary>
	public ColumnValue GetID_GasolineraValue()
	{
		return this.GetValue(TableUtils.ID_GasolineraColumn);
	}

	/// <summary>
	/// This is a convenience method that provides direct access to the value of the record's Gasolinera_.ID_Gasolinera field.
	/// </summary>
	public Int32 GetID_GasolineraFieldValue()
	{
		return this.GetValue(TableUtils.ID_GasolineraColumn).ToInt32();
	}

	/// <summary>
	/// This is a convenience method that provides direct access to the value of the record's Gasolinera_.Nombre_Gasolinera field.
	/// </summary>
	public ColumnValue GetNombre_GasolineraValue()
	{
		return this.GetValue(TableUtils.Nombre_GasolineraColumn);
	}

	/// <summary>
	/// This is a convenience method that provides direct access to the value of the record's Gasolinera_.Nombre_Gasolinera field.
	/// </summary>
	public string GetNombre_GasolineraFieldValue()
	{
		return this.GetValue(TableUtils.Nombre_GasolineraColumn).ToString();
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.Nombre_Gasolinera field.
	/// </summary>
	public void SetNombre_GasolineraFieldValue(ColumnValue val)
	{
		this.SetValue(val, TableUtils.Nombre_GasolineraColumn);
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.Nombre_Gasolinera field.
	/// </summary>
	public void SetNombre_GasolineraFieldValue(string val)
	{
		ColumnValue cv = new ColumnValue(val);
		this.SetValue(cv, TableUtils.Nombre_GasolineraColumn);
	}
	/// <summary>
	/// This is a convenience method that provides direct access to the value of the record's Gasolinera_.latitud field.
	/// </summary>
	public ColumnValue GetlatitudValue()
	{
		return this.GetValue(TableUtils.latitudColumn);
	}

	/// <summary>
	/// This is a convenience method that provides direct access to the value of the record's Gasolinera_.latitud field.
	/// </summary>
	public Double GetlatitudFieldValue()
	{
		return this.GetValue(TableUtils.latitudColumn).ToDouble();
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.latitud field.
	/// </summary>
	public void SetlatitudFieldValue(ColumnValue val)
	{
		this.SetValue(val, TableUtils.latitudColumn);
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.latitud field.
	/// </summary>
	public void SetlatitudFieldValue(string val)
	{
		this.SetString(val, TableUtils.latitudColumn);
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.latitud field.
	/// </summary>
	public void SetlatitudFieldValue(double val)
	{
		ColumnValue cv = new ColumnValue(val);
		this.SetValue(cv, TableUtils.latitudColumn);
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.latitud field.
	/// </summary>
	public void SetlatitudFieldValue(decimal val)
	{
		ColumnValue cv = new ColumnValue(val);
		this.SetValue(cv, TableUtils.latitudColumn);
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.latitud field.
	/// </summary>
	public void SetlatitudFieldValue(long val)
	{
		ColumnValue cv = new ColumnValue(val);
		this.SetValue(cv, TableUtils.latitudColumn);
	}
	/// <summary>
	/// This is a convenience method that provides direct access to the value of the record's Gasolinera_.longitud field.
	/// </summary>
	public ColumnValue GetlongitudValue()
	{
		return this.GetValue(TableUtils.longitudColumn);
	}

	/// <summary>
	/// This is a convenience method that provides direct access to the value of the record's Gasolinera_.longitud field.
	/// </summary>
	public Double GetlongitudFieldValue()
	{
		return this.GetValue(TableUtils.longitudColumn).ToDouble();
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.longitud field.
	/// </summary>
	public void SetlongitudFieldValue(ColumnValue val)
	{
		this.SetValue(val, TableUtils.longitudColumn);
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.longitud field.
	/// </summary>
	public void SetlongitudFieldValue(string val)
	{
		this.SetString(val, TableUtils.longitudColumn);
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.longitud field.
	/// </summary>
	public void SetlongitudFieldValue(double val)
	{
		ColumnValue cv = new ColumnValue(val);
		this.SetValue(cv, TableUtils.longitudColumn);
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.longitud field.
	/// </summary>
	public void SetlongitudFieldValue(decimal val)
	{
		ColumnValue cv = new ColumnValue(val);
		this.SetValue(cv, TableUtils.longitudColumn);
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.longitud field.
	/// </summary>
	public void SetlongitudFieldValue(long val)
	{
		ColumnValue cv = new ColumnValue(val);
		this.SetValue(cv, TableUtils.longitudColumn);
	}
	/// <summary>
	/// This is a convenience method that provides direct access to the value of the record's Gasolinera_.GEOLocalisacion field.
	/// </summary>
	public ColumnValue GetGEOLocalisacionValue()
	{
		return this.GetValue(TableUtils.GEOLocalisacionColumn);
	}

	/// <summary>
	/// This is a convenience method that provides direct access to the value of the record's Gasolinera_.GEOLocalisacion field.
	/// </summary>
	public string GetGEOLocalisacionFieldValue()
	{
		return this.GetValue(TableUtils.GEOLocalisacionColumn).ToString();
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.GEOLocalisacion field.
	/// </summary>
	public void SetGEOLocalisacionFieldValue(ColumnValue val)
	{
		this.SetValue(val, TableUtils.GEOLocalisacionColumn);
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.GEOLocalisacion field.
	/// </summary>
	public void SetGEOLocalisacionFieldValue(string val)
	{
		ColumnValue cv = new ColumnValue(val);
		this.SetValue(cv, TableUtils.GEOLocalisacionColumn);
	}
	/// <summary>
	/// This is a convenience method that provides direct access to the value of the record's Gasolinera_.Descripcion field.
	/// </summary>
	public ColumnValue GetDescripcionValue()
	{
		return this.GetValue(TableUtils.DescripcionColumn);
	}

	/// <summary>
	/// This is a convenience method that provides direct access to the value of the record's Gasolinera_.Descripcion field.
	/// </summary>
	public string GetDescripcionFieldValue()
	{
		return this.GetValue(TableUtils.DescripcionColumn).ToString();
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.Descripcion field.
	/// </summary>
	public void SetDescripcionFieldValue(ColumnValue val)
	{
		this.SetValue(val, TableUtils.DescripcionColumn);
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.Descripcion field.
	/// </summary>
	public void SetDescripcionFieldValue(string val)
	{
		ColumnValue cv = new ColumnValue(val);
		this.SetValue(cv, TableUtils.DescripcionColumn);
	}
	/// <summary>
	/// This is a convenience method that provides direct access to the value of the record's Gasolinera_.Observaciones field.
	/// </summary>
	public ColumnValue GetObservacionesValue()
	{
		return this.GetValue(TableUtils.ObservacionesColumn);
	}

	/// <summary>
	/// This is a convenience method that provides direct access to the value of the record's Gasolinera_.Observaciones field.
	/// </summary>
	public string GetObservacionesFieldValue()
	{
		return this.GetValue(TableUtils.ObservacionesColumn).ToString();
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.Observaciones field.
	/// </summary>
	public void SetObservacionesFieldValue(ColumnValue val)
	{
		this.SetValue(val, TableUtils.ObservacionesColumn);
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.Observaciones field.
	/// </summary>
	public void SetObservacionesFieldValue(string val)
	{
		ColumnValue cv = new ColumnValue(val);
		this.SetValue(cv, TableUtils.ObservacionesColumn);
	}
	/// <summary>
	/// This is a convenience method that provides direct access to the value of the record's Gasolinera_.ID_marca field.
	/// </summary>
	public ColumnValue GetID_marcaValue()
	{
		return this.GetValue(TableUtils.ID_marcaColumn);
	}

	/// <summary>
	/// This is a convenience method that provides direct access to the value of the record's Gasolinera_.ID_marca field.
	/// </summary>
	public Int32 GetID_marcaFieldValue()
	{
		return this.GetValue(TableUtils.ID_marcaColumn).ToInt32();
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.ID_marca field.
	/// </summary>
	public void SetID_marcaFieldValue(ColumnValue val)
	{
		this.SetValue(val, TableUtils.ID_marcaColumn);
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.ID_marca field.
	/// </summary>
	public void SetID_marcaFieldValue(string val)
	{
		this.SetString(val, TableUtils.ID_marcaColumn);
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.ID_marca field.
	/// </summary>
	public void SetID_marcaFieldValue(double val)
	{
		ColumnValue cv = new ColumnValue(val);
		this.SetValue(cv, TableUtils.ID_marcaColumn);
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.ID_marca field.
	/// </summary>
	public void SetID_marcaFieldValue(decimal val)
	{
		ColumnValue cv = new ColumnValue(val);
		this.SetValue(cv, TableUtils.ID_marcaColumn);
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.ID_marca field.
	/// </summary>
	public void SetID_marcaFieldValue(long val)
	{
		ColumnValue cv = new ColumnValue(val);
		this.SetValue(cv, TableUtils.ID_marcaColumn);
	}


#endregion

#region "Convenience methods to get field names"

	/// <summary>
	/// This is a property that provides direct access to the value of the record's Gasolinera_.ID_Gasolinera field.
	/// </summary>
	public Int32 ID_Gasolinera
	{
		get
		{
			return this.GetValue(TableUtils.ID_GasolineraColumn).ToInt32();
		}
		set
		{
			ColumnValue cv = new ColumnValue(value);
			this.SetValue(cv, TableUtils.ID_GasolineraColumn);
		}
	}


	/// <summary>
	/// This is a convenience method that can be used to determine that the column is set.
	/// </summary>
	public bool ID_GasolineraSpecified
	{
		get
		{
			ColumnValue val = this.GetValue(TableUtils.ID_GasolineraColumn);
            if (val == null || val.IsNull)
            {
                return false;
            }
            return true;
		}
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.ID_Gasolinera field.
	/// </summary>
	public string ID_GasolineraDefault
	{
		get
		{
			return TableUtils.ID_GasolineraColumn.DefaultValue;
		}
	}
	/// <summary>
	/// This is a property that provides direct access to the value of the record's Gasolinera_.Nombre_Gasolinera field.
	/// </summary>
	public string Nombre_Gasolinera
	{
		get
		{
			return this.GetValue(TableUtils.Nombre_GasolineraColumn).ToString();
		}
		set
		{
			ColumnValue cv = new ColumnValue(value);
			this.SetValue(cv, TableUtils.Nombre_GasolineraColumn);
		}
	}


	/// <summary>
	/// This is a convenience method that can be used to determine that the column is set.
	/// </summary>
	public bool Nombre_GasolineraSpecified
	{
		get
		{
			ColumnValue val = this.GetValue(TableUtils.Nombre_GasolineraColumn);
            if (val == null || val.IsNull)
            {
                return false;
            }
            return true;
		}
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.Nombre_Gasolinera field.
	/// </summary>
	public string Nombre_GasolineraDefault
	{
		get
		{
			return TableUtils.Nombre_GasolineraColumn.DefaultValue;
		}
	}
	/// <summary>
	/// This is a property that provides direct access to the value of the record's Gasolinera_.latitud field.
	/// </summary>
	public Double latitud
	{
		get
		{
			return this.GetValue(TableUtils.latitudColumn).ToDouble();
		}
		set
		{
			ColumnValue cv = new ColumnValue(value);
			this.SetValue(cv, TableUtils.latitudColumn);
		}
	}


	/// <summary>
	/// This is a convenience method that can be used to determine that the column is set.
	/// </summary>
	public bool latitudSpecified
	{
		get
		{
			ColumnValue val = this.GetValue(TableUtils.latitudColumn);
            if (val == null || val.IsNull)
            {
                return false;
            }
            return true;
		}
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.latitud field.
	/// </summary>
	public string latitudDefault
	{
		get
		{
			return TableUtils.latitudColumn.DefaultValue;
		}
	}
	/// <summary>
	/// This is a property that provides direct access to the value of the record's Gasolinera_.longitud field.
	/// </summary>
	public Double longitud
	{
		get
		{
			return this.GetValue(TableUtils.longitudColumn).ToDouble();
		}
		set
		{
			ColumnValue cv = new ColumnValue(value);
			this.SetValue(cv, TableUtils.longitudColumn);
		}
	}


	/// <summary>
	/// This is a convenience method that can be used to determine that the column is set.
	/// </summary>
	public bool longitudSpecified
	{
		get
		{
			ColumnValue val = this.GetValue(TableUtils.longitudColumn);
            if (val == null || val.IsNull)
            {
                return false;
            }
            return true;
		}
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.longitud field.
	/// </summary>
	public string longitudDefault
	{
		get
		{
			return TableUtils.longitudColumn.DefaultValue;
		}
	}
	/// <summary>
	/// This is a property that provides direct access to the value of the record's Gasolinera_.GEOLocalisacion field.
	/// </summary>
	public string GEOLocalisacion
	{
		get
		{
			return this.GetValue(TableUtils.GEOLocalisacionColumn).ToString();
		}
		set
		{
			ColumnValue cv = new ColumnValue(value);
			this.SetValue(cv, TableUtils.GEOLocalisacionColumn);
		}
	}


	/// <summary>
	/// This is a convenience method that can be used to determine that the column is set.
	/// </summary>
	public bool GEOLocalisacionSpecified
	{
		get
		{
			ColumnValue val = this.GetValue(TableUtils.GEOLocalisacionColumn);
            if (val == null || val.IsNull)
            {
                return false;
            }
            return true;
		}
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.GEOLocalisacion field.
	/// </summary>
	public string GEOLocalisacionDefault
	{
		get
		{
			return TableUtils.GEOLocalisacionColumn.DefaultValue;
		}
	}
	/// <summary>
	/// This is a property that provides direct access to the value of the record's Gasolinera_.Descripcion field.
	/// </summary>
	public string Descripcion
	{
		get
		{
			return this.GetValue(TableUtils.DescripcionColumn).ToString();
		}
		set
		{
			ColumnValue cv = new ColumnValue(value);
			this.SetValue(cv, TableUtils.DescripcionColumn);
		}
	}


	/// <summary>
	/// This is a convenience method that can be used to determine that the column is set.
	/// </summary>
	public bool DescripcionSpecified
	{
		get
		{
			ColumnValue val = this.GetValue(TableUtils.DescripcionColumn);
            if (val == null || val.IsNull)
            {
                return false;
            }
            return true;
		}
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.Descripcion field.
	/// </summary>
	public string DescripcionDefault
	{
		get
		{
			return TableUtils.DescripcionColumn.DefaultValue;
		}
	}
	/// <summary>
	/// This is a property that provides direct access to the value of the record's Gasolinera_.Observaciones field.
	/// </summary>
	public string Observaciones
	{
		get
		{
			return this.GetValue(TableUtils.ObservacionesColumn).ToString();
		}
		set
		{
			ColumnValue cv = new ColumnValue(value);
			this.SetValue(cv, TableUtils.ObservacionesColumn);
		}
	}


	/// <summary>
	/// This is a convenience method that can be used to determine that the column is set.
	/// </summary>
	public bool ObservacionesSpecified
	{
		get
		{
			ColumnValue val = this.GetValue(TableUtils.ObservacionesColumn);
            if (val == null || val.IsNull)
            {
                return false;
            }
            return true;
		}
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.Observaciones field.
	/// </summary>
	public string ObservacionesDefault
	{
		get
		{
			return TableUtils.ObservacionesColumn.DefaultValue;
		}
	}
	/// <summary>
	/// This is a property that provides direct access to the value of the record's Gasolinera_.ID_marca field.
	/// </summary>
	public Int32 ID_marca
	{
		get
		{
			return this.GetValue(TableUtils.ID_marcaColumn).ToInt32();
		}
		set
		{
			ColumnValue cv = new ColumnValue(value);
			this.SetValue(cv, TableUtils.ID_marcaColumn);
		}
	}


	/// <summary>
	/// This is a convenience method that can be used to determine that the column is set.
	/// </summary>
	public bool ID_marcaSpecified
	{
		get
		{
			ColumnValue val = this.GetValue(TableUtils.ID_marcaColumn);
            if (val == null || val.IsNull)
            {
                return false;
            }
            return true;
		}
	}

	/// <summary>
	/// This is a convenience method that allows direct modification of the value of the record's Gasolinera_.ID_marca field.
	/// </summary>
	public string ID_marcaDefault
	{
		get
		{
			return TableUtils.ID_marcaColumn.DefaultValue;
		}
	}


#endregion
}

}
